import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main1{
    public static void main(String[] args) {
       String ret="";
       String arr="adhjksf";
       int a=2;
       while(a-->0){
           ret=ret+arr;
       }
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
      String ret=in.nextLine();

    String ret1=ret.substring(ret.length()/2,ret.length());
    String ret2="";
   if(ret.length()%2==0) {
   ret2=ret.substring(0,ret.length()/2);
   }else{
    ret2=ret.substring(0,(ret.length()/2)+1);
   }
   StringBuffer sb=new StringBuffer(ret2);
    sb=sb.reverse();
   String ret3= sb.toString();
     if(ret3.equals(ret1)){
        System.out.println(ret.length());
     }else{
        System.out.println(ret.length()-1);
     }
    }
}